<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import orderDetailCard from "../components/order/orderDetailCard.vue";
import { ref } from "vue";
import { apiOrderDetail } from "@/apis/order";
import { onShow } from "@dcloudio/uni-app";
// 场景
const scene = ref("buy");
const detail = ref({});
const orderId = ref(0);
const getDetail = async () => {
  let res = await apiOrderDetail({ id: orderId.value });
  detail.value = res.data;
};
onShow(() => {
  getDetail();
});
onLoad((options: any) => {
  scene.value = options.scene;
  orderId.value = options.id;
});
</script>
<template>
  <view class="container">
    <orderDetailCard
      :orderDetail="detail"
      :scene="scene"
      :getDetail="getDetail"
    />
  </view>
</template>
<style scoped></style>
